Events::Events(){
	
	ifstream in;
	in.open( "events/events.evt" );
	if( !in.is_open() ){
		cerr << "Error in Events class constructor: could not open events file" << endl;
		exit( -1 );
	}
	
	struct event evt;
	while( in >> evt.vn_id >> evt.type >> evt.time )
		events.push_back( evt );
	
	events.sort( compare_events );
}

struct event Events::getNextEvent(){
	struct event evt = events.front();
	events.pop_front();
	return evt;
}

int Events::eventsLeft(){
	return events.size();
}